package com.example.mybatis.Service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.mybatis.Pojo.TallyBook;
import com.example.mybatis.Service.TallyBookService;
import com.example.mybatis.mapper.TallyBookMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class TallyBookServiceImpl extends ServiceImpl<TallyBookMapper, TallyBook> implements TallyBookService {

    //通过学号来查询当前借阅情况
    public List<TallyBook> getTallyBookListByUsername(String username) {
        QueryWrapper<TallyBook> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("username", username);
        return list(queryWrapper);
    }
}
